<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/vue.js"></script>
</head>
<template id="cpn_id">
    <div>
        <slot>我是默认插槽名称</slot>
        <slot name="another">我是another插槽</slot>
        <slot name="other">我是other插槽</slot>
        <p>我是子组件</p>
    </div>
</template>
<body>
<div id="div_id">
    <!--当元素的slot属性等于插槽的名称时，会替换对应的插槽-->
    <cpn><p  slot="another">我是父组件传递来的插槽</p></cpn>
</div>
<script>
    const app=new Vue({
        el:"#div_id",
        components:{
            cpn:{
                template:"#cpn_id"
            }
        }
    })
</script>
</body>
</html>